<?php

namespace Acme\DomotiqueBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;

use Acme\DomotiqueBundle\Entity\Room;


/**
 */
class RoomController extends Controller
{

    public function getAllAction(){

    	$rooms = $this->getDoctrine()
        	->getRepository('DomotiqueBundle:Room')
        	->findAll();
        foreach($rooms as $room){
        	$tabRooms[$room->getId()] = $room->__toArray();
        }
       	return new Response(json_encode(array("response_code" => "ok", "rooms" => $tabRooms)));
    }
}